import axios from "../index.js";

// 车辆模板下载
export const downVehicle = (data) => {
  return axios.request({
    url: "/resource/excelTemplateDown/downVehicle",
    method: "get",
    data: data,
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    responseType: "blob"
  });
};
// 装备模板下载
export const downEquip = (data) => {
  return axios.request({
    url: "/resource/excelTemplateDown/downEquip",
    method: "get",
    data: data,
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    responseType: "blob"
  });
};
// 根据单位选择部门班组
export const selectOrganizationDetailPCByidVo = (data) => {
  return axios.request({
    url: "/system/organization/selectOrganizationDetailPCByidVo",
    method: "get",
    data: data
  });
};
// 车辆新增
export const saveBaseResourceVehicle = (data) => {
  return axios.request({
    url: "/resource/baseResourceVehicle/save",
    method: "post",
    data: data
  });
};
// 车辆修改
export const updByIdBaseResourceVehicle = (data) => {
  return axios.request({
    url: "/resource/baseResourceVehicle/updById",
    method: "post",
    data: data
  });
};
// 车辆详情
export const baseResourceVehicleGetBetails = (data) => {
  return axios.request({
    url: "/resource/baseResourceVehicle/details",
    method: "get",
    data: data
  });
};
// 车辆删除
export const baseResourceVehicleGetDeleteById = (data) => {
  return axios.request({
    url: "/resource/baseResourceVehicle/deleteById",
    method: "get",
    data: data
  });
};
// 车辆导出
export const baseResourceVehicleGetDderiveByIds = (data) => {
  return axios.request({
    url: `/resource/baseResourceVehicle/deriveByIds?ids=${data}`,
    method: "get",
    data: data,
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    responseType: "blob"
  });
};
// 车辆-获取所有车牌号
export const selectLicence = (data) => {
  return axios.request({
    url: "/resource/baseResourceVehicle/selectLicence",
    method: "get",
    data: data
  });
};
// 车辆导入
export const doImportVehicleExcel = (data) => {
  return axios.request({
    url: "/resource/vehicleImportExcel/doImportVehicleExcel",
    method: "post",
    data: data,
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    responseType: "blob"
  });
};
// 装备导入
export const doImportEquipExcel = (data) => {
  return axios.request({
    url: "/resource/equipImportExcel/doImportEquipExcel",
    method: "post",
    data: data,
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    responseType: "blob"

  });
};
// 物资导入
export const doImportSuppliesExcel = (data) => {
  return axios.request({
    url: "/resource/suppliesImportExcel/doImportSuppliesExcel",
    method: "post",
    data: data,
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    responseType: "blob"
  });
};
// 装备新增
export const baseResourceEquipSave = (data) => {
  return axios.request({
    url: "/resource/baseResourceEquip/save",
    method: "post",
    data: data
  });
};
// 装备详情
export const baseResourceEquipDetails = (data) => {
  return axios.request({
    url: "/resource/baseResourceEquip/details",
    method: "get",
    data: data
  });
};
// 装备修改
export const baseResourceEquipUpdById = (data) => {
  return axios.request({
    url: "/resource/baseResourceEquip/updById",
    method: "post",
    data: data
  });
};
// 装备删除
export const baseResourceEquipDeleteById = (data) => {
  return axios.request({
    url: "/resource/baseResourceEquip/deleteById",
    method: "get",
    data: data
  });
};
// 装备导出
export const baseResourceEquipDderiveByIds = (data) => {
  return axios.request({
    url: `/resource/baseResourceEquip/deriveByIds?ids=${data}`,
    method: "get",
    data: data,
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    responseType: "blob"
  });
};
// 装备大类
export const getDicListlargeCategory = (data) => {
  return axios.request({
    url: `/system/dic/getDicList`,
    method: "get",
    data: data
  });
};
// 装备小类
export const doSelectCascade = (data) => {
  return axios.request({
    url: `/system/dic/doSelectCascade`,
    method: "get",
    data: data
  });
};
// 物资模板下载
export const downSupplies = (data) => {
  return axios.request({
    url: "/resource/excelTemplateDown/downSupplies",
    method: "get",
    data: data,
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    responseType: "blob"
  });
};

// 物资新增
export const baseResourceSuppliesSave = (data) => {
  return axios.request({
    url: "/resource/baseResourceSupplies/save",
    method: "post",
    data: data
  });
};
// 物资修改
export const baseResourceSuppliesUpdById = (data) => {
  return axios.request({
    url: "/resource/baseResourceSupplies/updateById",
    method: "post",
    data: data
  });
};
// 物资导出
export const baseResourceSuppliExportByIds = (data) => {
  return axios.request({
    url: `/resource/baseResourceSupplies/exportByIds?ids=${data}`,
    method: "get",
    data: data,
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    responseType: "blob"
  });
};
// 物资详情
export const baseResourceSuppliesDetailsById = (data) => {
  return axios.request({
    url: "/resource/baseResourceSupplies/detailsById",
    method: "get",
    data: data
  });
};
// 物资删除
export const baseResourceSuppliesDeleteByIds = (data) => {
  return axios.request({
    url: "/resource/baseResourceSupplies/deleteByIds",
    method: "post",
    data: data
  });
};
